package day2.homework;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public
class Demo4 {
    public static
    void main(String[] args) {
        try (
                FileReader fr=new FileReader("D:\\IO\\testIO.txt");
                FileWriter fw=new FileWriter("D:\\IO\\testIO1.txt");)
        {
            char[] chars=new char[10];
            int len;
            while ((len=fr.read(chars))!=-1){
                fw.write(chars,0,len);
            }
            System.out.println("复制完毕");
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
